package com.autonavi.collapse.task.context;

import java.util.Map;

public class TaskComponentContainer {

    private static ContextManager contextManager;

    public static void init(ContextManager manager) throws Exception{
        contextManager = manager;
        manager.init();
    }

    public static <T> T getComponent(Class<T> type){
        return contextManager.getComponentByType(type);
    }

    public static Object getComponent(String name){
        return contextManager.getComponentByName(name);
    }

    public static <T> Map<String, T> getComponents(Class<T> type){
        return contextManager.getComponentsByType(type);
    }
}
